package cn.edu.sig.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.edu.sig.bean.CurrentPage;
import cn.edu.sig.bean.Image;
import cn.edu.sig.bean.Message;
import cn.edu.sig.dao.MessageDao;

@Service("messageService")
@Transactional
public class MessageService {

	@Resource(name="messageDao")
	private MessageDao messageDao; 
	
	public void addMessage(Message message){
		
		messageDao.add(message);
	}
	
	public CurrentPage<Message> findAllMessage(int pageNo, int pageSize){
		
		return messageDao.findAll(pageNo, pageSize);
	}

	public void deleteMessge(Integer goodsId){
		
		messageDao.delete(goodsId);
	}
	
	public List<Message> findAll(){
		
		return messageDao.findAll();
	}
	
}
